package edu.yuhf.collectiondemo;

import java.util.Iterator;
import java.util.Set;

public class HashSetExample {

    public static <String> void iteratorOperation(Set<String> set){
        //set.stream().forEach(System.out::println);
        /*
        for(String key : set){
           System.out.println(key);
        }*/
        Iterator iterator = set.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
